package businessEntities;

public class BEFileUtils {

    /**
     * @param filePath - represent path of file in file system. 
     *                  <code>filePath</code> is a string does not contain '//' or '\'.
     *                  If <code>filePath</code> doesn't contain '.' <code>null</code> will be return.
     * @return the extention of <code>filePath</code>. or <code>null</code> if any exception occurred. 
     */
    public static String getFileExtention(String filePath) {
        try {
            int mid = filePath.lastIndexOf(".");
            String ext = filePath.substring(mid + 1, filePath.length());
            return ext;
        } catch (Throwable t) {
            return null;
        }
    }
}
